<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<include file="Admin:head" />

	<body>
		<include file="Admin:top" />
		<div class="container-fluid">
			<div class="row">
				<include file="Admin:leftmenu" />
				<div class="col-md-10">

					<ol class="breadcrumb">
						<li>
							用户管理
						</li>
						<li class="active">用户列表</li>
					</ol>
					<script>
						function jumpUrl() {
							var v = document.getElementById("usergroup").options[document.getElementById("usergroup").selectedIndex].value;
							window.location.href = v;
						}
					</script>
					<div class="form-inline">
						<form action="<{:U('Admin/user_list')}>" method="post">
							<div class="form-group">
								<label>用户组：</label>
								<select name="usergroup" id="usergroup" class="form-control input-sm" onchange="jumpUrl()">
									<option value="<{:U('Admin/user_list')}>" <if condition="$nowgroup eq 'all'">selected="selected"</if>>全部</option>
									<option value="<{:U('Admin/user_list',array('usergroup'=>0))}>" <if condition="$nowgroup eq '0'">selected="selected"</if>>学生组</option>
									<option value="<{:U('Admin/user_list',array('usergroup'=>1))}>" <if condition="$nowgroup eq '1'">selected="selected"</if>>教师组</option>
									<option value="<{:U('Admin/user_list',array('usergroup'=>2))}>" <if condition="$nowgroup eq '2'">selected="selected"</if>>管理员组</option>
								</select>
							</div>

							<div class="form-group">
								<label>用户id或昵称：</label>
								<input type="text" class="form-control input-sm" name="key" value="<{$key}>">
							</div>
							<button type="submit" class="btn btn-default btn-sm">搜索</button>
						</form>
					</div>

					<p></p>

					<form id="ajaxForm" method="post" action="" name="form1" class="form-horizontal form-validata">
						<TABLE class="table table-striped table-bordered table-hover">
							<THEAD>
								<tr>
									<TH>用户id</TH>
									<TH>昵称</TH>
									<TH>注册ip</TH>
									<TH>注册时间</TH>
									<TH>年级</TH>
									<TH>上次登录ip</TH>
									<TH>上次登录时间</TH>
									<TH>重置密码</TH>
									<TH>删除用户</TH>
								</tr>
							</THEAD>
							<TBODY>
								<volist name="data" id="ar">
									<tr>
										<td>
											<{$ar.id}>
										</td>
										<td>
											<a href="<{:U('Admin/user_view',array('id'=>$ar['id']))}>" class="preview" alt="" title="<{$ar.title}>">
												<{$ar.nick}>
											</a>
										</td>
										<td>
											<{$ar.reg_ip}>
										</td>
										<td>
											<php>
												echo date("Y-m-d H:m:s",$ar['reg_time']);
											</php>
										</td>
										<td>
											<php>
												echo $ar['grade']==''?未设置:$ar['grade'];
											</php>
										</td>
										<td>
											<php>
												echo $ar['last_login_ip']==''?未登录:$ar['last_login_ip'];
											</php>
										</td>
										<td>
											<php>
												echo $ar['last_login_time']==''?未登录:$ar['last_login_time'];
											</php>
										</td>
										<td>
											<a class="btn btn-xs btn-warning" href="<{:U('Admin/setPasswordToDefault',array('id'=>$ar['id']))}>">重置密码</a>
										</td>
										<td>
											<a class="btn btn-xs btn-danger" href="<{:U('Article/delete',array('id'=>$ar['id']))}>">删除</a>
										</td>
									</tr>

								</volist>
							</TBODY>
						</TABLE>

						<div class="row">
							<div class="col-md-6">
								<div class="page">
									<nav>
										<ul class="pagination">
											<li>
												<span>第<{$pagenow}>页&nbsp;&nbsp;共<{$pagenum}>页</span>
												<for start="1" end="$pagenum+1">
													<a href="<{:U('Article/showlist',array('page'=>$i))}>" <if condition="$i eq $pagenow ">class="now"</if>
														>
														<{$i}>
													</a>
												</for>
											</li>
										</ul>
									</nav>
								</div>
							</div>
						</div>
					</form>

					<script type="text/javascript">
						$("#path").val("");
					</script>

					<input type="hidden" id="menu_action" value="user" />
				</div>
			</div>

		</div>

		<include file="Admin:menu_action" />

	</body>

</html>